/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved.
 */
package com.kaaction.modules.operate.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.service.TreeService;
import com.kaaction.common.utils.StringUtils;
import com.kaaction.modules.operate.entity.Activity;
import com.kaaction.modules.operate.dao.ActivityDao;

/**
 * 活动Service
 * @author zengbiao
 * @version 2017-04-12
 */
@Service
@Transactional(readOnly = true)
public class ActivityService extends TreeService<ActivityDao, Activity> {

	public Activity get(String id) {
		return super.get(id);
	}
	
	public List<Activity> findList(Activity activity) {
		if (StringUtils.isNotBlank(activity.getParentIds())){
			activity.setParentIds(","+activity.getParentIds()+",");
		}
		return super.findList(activity);
	}
	
	@Transactional(readOnly = false)
	public void save(Activity activity) {
		super.save(activity);
	}
	
	@Transactional(readOnly = false)
	public void delete(Activity activity) {
		super.delete(activity);
	}
	
}